<div class="row">
    <div class="span9">
        <article class="panel" id="{{article._id}}">
            <header class="page-header">
                <h4>{{article.title}}</h4>
                <ul class="list-inline">
                    <li ng-show="article.refer">引文:<a ng-href="{{article.refer.url}}">{{article.refer.url}}</a></li>
                    <li>发表:{{article.date | formatDate}}</li>
                    <li>更新:{{article.updateTime | formatDate}}</li>
                    <li>访问:{{article.visitors}}次</li>
                    <li>热度:{{article.hots}}</li>
                    <li><a class="btn btn-mini btn-success" ng-click="reply(article)">{{article.comments}}条评论</a></li>
                    <li ng-show="isMe||isEditor"><a class="btn btn-mini btn-primary" ng-href="{{'/'+article._id+'/edit'}}">编辑</a></li>
                </ul>
                <ul class="list-inline">
                    <li ng-repeat="tag in article.tagsList">
                        <a ng-href="{{'/'+tag._id}}" class="btn btn-mini">{{tag.tag}}</a>
                    </li>
                </ul>
            </header>
            <section ng-parse-markdown="article.content">
            </section>
            <footer class="clearfix page-footer">
                <div class="btn-toolbar pull-right">
                    <div class="btn-group">
                        <a type="button" class="btn btn-success" ng-click="setFavor(article)">{{article.isFavor | favor}}[{{article.favorsList.length}}]</a>
                        <a type="button" class="btn btn-primary" ng-click="setMark(article)">{{article.isMark | mark}}[{{article.markList.length}}]</a>
                        <a type="button" class="btn btn-warning" ng-click="setOppose(article)">{{article.isOppose | oppose}}[{{article.opposesList.length}}]</a>
                    </div>
                    <div class="btn-group">
                            <a type="button" ng-click="reply(article)" class="btn btn-primary">发表评论</a>
                    </div>
                </div>
                <ul class="list-inline" ng-show="article.favorsList">
                    <li>支持：</li>
                    <li ng-repeat="user in article.favorsList">
                        <a ng-href="{{'/'+user._id}}">{{user.name}}</a>
                    </li>
                </ul>
                <ul class="list-inline" ng-show="article.opposesList">
                    <li>反对：</li>
                    <li ng-repeat="user in article.opposesList">
                        <a ng-href="{{'/'+user._id}}">{{user.name}}</a>
                    </li>
                </ul>
                <ul class="list-inline" ng-show="article.markList">
                    <li>收藏：</li>
                    <li ng-repeat="user in article.markList">
                        <a ng-href="{{'/'+user._id}}">{{user.name}}</a>
                    </li>
                </ul>
                <div ng-show="article.collection">所属合集：<a ng-href="{{'/'+article.collection._id}}">{{article.collection.title}}</a>
                </div>
            </footer>
        </article>
        <aside class="panel clearfix" id="comments">
            <section id="reply" class="clearfix">
                <h5>{{replyTitle}}</h5>
                <div id="wmd-preview" class="well wmd-preview" ng-show="wmdShow=='preview'">
                </div>
                <div class="well wmd-preview" ng-show="wmdShow=='help'" ng-parse-markdown="markdownHelp">
                </div>
                <form name="addArticle" ng-show="wmdShow=='edit'">
                    <div id="wmd-button-bar">
                    </div>
                    <span class="text-warning">
                    [markdown语法，{{global.ContentMinLen}} 到 {{global.ContentMaxLen}} 字节，当前<strong>{{contentBytes}}</strong>字节]
                    </span>
                    <textarea class="wmd-input" id="wmd-input" ng-model="content" rows="6"
                    required>
                    </textarea>
                </form>
                <div class="btn-toolbar well well-small pull-right">
                    <div class="btn-group">
                        <a type="button" class="btn btn-success" ng-click="wmdHelp('preview')">文章预览</a>
                        <a type="button" class="btn btn-success" ng-click="wmdHelp('edit')" ng-hide="wmdShow=='edit'">编辑文章</a>
                        <a type="button" class="btn btn-success" ng-click="wmdHelp('help')">Markdown语法</a>
                    </div>
                    <div class="btn-group">
                        <a type="button" ng-click="reply(article)" class="btn btn-primary" ng-show="replyToComment">取消</a>
                    </div>
                    <div class="btn-group">
                        <a type="button" ng-click="submit()" class="btn btn-primary" ng-disabled="!editSave">提    交</a>
                    </div>
                </div>
            </section>
            <ul class="media-list">
                <li class="media" ng-repeat="comment in article.commentsList">
                  <a class="pull-left" ng-href="{{'/'+comment.author._id}}">
                    <img class="media-object" ng-src="{{comment.author.avatar}}">
                  </a>
                  <div class="media-body" id="{{comment._id}}">
                    <header class="media-heading">
                        <h6><a href="#" ng-click="getComments(comment.refer._id, comment)">{{comment.title}}</a></h6>
                    </header>
                    <div class="media-content" ng-parse-markdown="comment.content"></div>
                    <footer>
                        <span><a ng-href="{{'/'+comment.author._id}}">{{comment.author.name}}</a>
                            {{comment.date | formatDate}}发表</span>
                        <div class="btn-toolbar pull-right">
                            <div class="btn-group">
                                <a type="button" class="btn btn-mini" ng-click="setFavor(comment)">{{comment.isFavor | favor}}[{{comment.favorsList.length}}]</a>
                                <a type="button" class="btn btn-mini" ng-click="getComments(comment.commentsList, comment)">评论[{{comment.commentsList.length}}]</a>
                                <a type="button" class="btn btn-mini" ng-click="setOppose(comment)">{{comment.isOppose | oppose}}[{{comment.opposesList.length}}]</a>
                            </div>
                            <div class="btn-group">
                                    <a type="button" class="btn btn-mini" ng-click="reply(comment)" class="btn btn-primary">回复</a>
                            </div>
                        </div>
                    </footer>
                  </div>
                </li>
            </ul>
            <section id="refer-comments">
                <div class="media" ng-repeat="comment in referComments">
                  <a class="pull-left" ng-href="{{'/'+comment.author._id}}">
                    <img class="media-object" ng-src="{{comment.author.avatar}}">
                  </a>
                  <div class="media-body">
                    <header class="media-heading">
                        <h6>{{comment.title}}</h6>
                    </header>
                    <section class="media-content" ng-parse-markdown="comment.content"></section>
                    <footer>
                        <span><a ng-href="{{'/'+comment.author._id}}">{{comment.author.name}}</a>
                            发表于{{comment.date | formatDate}}</span>
                        <div class="btn-toolbar pull-right">
                            <div class="btn-group">
                                <a type="button" class="btn btn-mini">{{comment.isFavor | favor}}[{{comment.favorsList.length}}]</a>
                                <a type="button" class="btn btn-mini">评论[{{comment.commentsList.length}}]</a>
                                <a type="button" class="btn btn-mini">{{comment.isOppose | oppose}}[{{comment.opposesList.length}}]</a>
                            </div>
                        </div>
                    </footer>
                  </div>
                </div>
            </section>
            <section class="pull-left" ng-pagination="pagination" ng-show="pagination"></section>
        </aside>
    </div>
    <div class="span3 sidebar">
        <div class="panel">
            <header class="inner">
                <strong class="muted">作者信息</strong>
            </header>
            <div class="inner">
                <div class="media">
                    <a class="pull-left" ng-href="{{'/'+article.author._id}}">
                        <img class="media-object" ng-src="{{article.author.avatar}}">
                    </a>
                    <div class="media-body">
                        <h5 class="media-heading"><a ng-href="{{'/'+article.author._id}}">{{article.author.name}}</a></h5>
                        <span ng-show="article.author.role">{{article.author.role | role}}</span><br />
                        <a class="btn btn-success" href="#" ng-click="followMe(article.author)" ng-hide="isMe">{{article.author.isFollow | follow}}</a>
                    </div>
                </div>
                <div class="inner">
                    <ul class="list-inline">
                        <li ng-show="article.author.score">
                            <span class="muted">积分：</span>{{article.author.score}}
                        </li>
                        <li ng-show="article.author.fans">
                            <span class="muted">粉丝：</span>{{article.author.fans}}
                        </li>
                        <li ng-show="article.author.follow">
                            <span class="muted">关注：</span>{{article.author.follow}}
                        </li>
                        <li ng-show="article.author.articles">
                            <span class="muted">文章/评论：</span>{{article.author.articles}}
                        </li>
                        <li ng-show="article.author.collections">
                            <span class="muted">合集：</span>{{article.author.collections}}
                        </li>
                    </ul>
                </div>
            </div>
        </div>
        <div class="panel">
            <header class="inner">
                <strong class="muted">作者文章</strong>
            </header>
            <ul class="media-list inner">
                <li class="media" ng-repeat="article in authorArticles">
                  <div class="media-body" id="{{article._id}}">
                    <span class="media-content"><a ng-href="{{'/'+article._id}}" title="{{article.author.name+'发表'}}">{{article.title}}</a></span>
                  </div>
                </li>
            </ul>
        </div>
        <div class="panel">
            <header class="inner">
                <strong class="muted">热门文章</strong>
            </header>
            <ul class="media-list inner">
                <li class="media" ng-repeat="article in hotArticles">
                  <div class="media-body" id="{{article._id}}">
                    <strong class="text-hot" title="热度"><em>{{article.hots}}</em></strong>&nbsp;
                    <span class="media-content"><a ng-href="{{'/'+article._id}}" title="{{article.author.name+'发表'}}">{{article.title}}</a></span>
                  </div>
                </li>
            </ul>
        </div>
    </div>
</div>
